// components/idcard-show/idcard-show.js
Component({
  properties: {
    obj:{
      type: Object,
      value: null
    },
    height:{
      type:String,
      value:null
    },
    width: {
      type: String,
      value: null
    },
    isImg: {
      type: Boolean,
      value:false,
    }
  },
  data:{
    // 宽高样式
    style:null,
    
  },
  methods: {
    showImg: (event)=>{
      wx.previewImage({
        urls: [event.currentTarget.dataset.url]
      })
    }
  },
  attached: function () {
       
    if (this.data.height != null && this.data.width != null){
      const style = `height:${this.data.height};width:${this.data.width};`
      this.setData({
        style
      })
    }
  },
})
